<?php 
class ShowNews extends CI_Controller  {
	function __construct()
 {
  	parent::__construct();
	$this->load->model('TB_link');
  	$this->load->model('TB_News');
 }
 	function index($id)
	{
		$data=$this->TB_News->get_NewsByNewsID($id);
		//点击率+1
		$Hits=$data[0]->Hits+1;
		$this->TB_News->UpdateHits($Hits,$id);
			
		$headTitle["title"]='中国乡土艺术协会_'.$data[0]->TypeName;
		$headTitle["NewsEnt"]=$data[0];
		$this->load->view("header",$headTitle);
		$this->load->view("shownews",$headTitle);
		
		$linklist['results']=$this->TB_link->get_links_last30();
		$this->load->view("footer",$linklist);
	}
	function classindex($ClassID)
	{
		$data["results"]=$this->TB_News->get_NewsByClassID($ClassID);
		$data["results"][0]->TypeID=0;
		$headTitle["title"]='中国乡土艺术协会_'.$data["results"][0]->ClassName;
	//	if()
		$headTitle["NewsEnt"]=$data["results"][0];
		$this->load->view("header",$headTitle);
		$this->load->view("newstype",$data);
		
		$linklist['results']=$this->TB_link->get_links_last30();
		$this->load->view("footer",$linklist);
	}
	function typeindex($ClassID,$TypeID)
	{
		$data["results"]=$this->TB_News->get_NewsByType($ClassID,$TypeID);
		$headTitle["title"]='中国乡土艺术协会_'.$data["results"][0]->TypeName;
		$headTitle["NewsEnt"]=$data["results"][0];
		$this->load->view("header",$headTitle);
		$this->load->view("newstype",$data);
		
		$linklist['results']=$this->TB_link->get_links_last30();
		$this->load->view("footer",$linklist);
	}
} 